<template>
  <nut-popup v-model:visible="show" position="bottom">
    <nut-picker
      v-model="val"
      :columns="columns"
      title="请选择车辆"
      @confirm="confirm"
      @cancel="show = false"
    />
  </nut-popup>
</template>
<script lang="js" setup>
import { ref,onMounted, defineProps,defineEmits } from 'vue'
const show = ref(false);
const val = ref();
const columns = ref([
  { text: '新A64356,四座,续航500km', value: 'Nanjing' },
  { text: '新A64256,八座,续航300km', value: 'Wuxi' },
  { text: '新A64356,两座,续航300km', value: 'Haibei' },
  { text: '新A64656,四座,续航500km', value: 'Beijing' },
  { text: '新A64456,四座,续航500km', value: 'Lianyungang' },
  { text: '新A64576,四座,续航560km', value: 'Changsha' },
  { text: '新A64856,四座,续航300km', value: 'Wuhan' }
]);

const confirm = ({ selectedValue, selectedOptions }) => {
  console.log(selectedValue[0], selectedOptions[0]);
  show.value = false;
};
function openShow(){
  show.value = true;

}
onMounted(() => {})
defineExpose({openShow})
</script>
<style lang="scss" scoped></style>
